/**
 * Copyright (C) 2013 
 *
 * @className:com.airchina.wechat.common.enums.OrderStatus
 * @description:
 * 
 * @version:v1.0.0 
 * @author:lining
 * 
 * Modification History:
 * Date         Author      Version     Description
 * -----------------------------------------------------------------
 * 2013年11月21日     lining       v1.0.0        create
 *
 *
 */
package com.china.itapi.common.enums;

/**
 * @Description: 订单状态
 * @author:lining
 * @version:v1.0.0
 * @Created:2013年11月21日下午1:38:05
 * @Modified:
 */
public enum OrderStatus {

	/**未支付*/
	NOPAY("1", "未支付"),
	
	/**支付中*/
	PAYING("2", "支付中"),
	
	/**支付完成*/
	PAYID("3", "支付完成"),
	
	/**出票中*/
	DRAWING("4", "出票中"),
	
	/**出票成功*/
	DRAW_OUT("5", "出票成功"),
	
	/**出票失败*/
	DRAW_FAIL("6", "出票失败"),
	
	/**退款中*/
	REFUNDS("7", "退款中"),
	
	/**退款成功*/
	REFUNDS_SUCESS("8", "退款成功"),
	
	/**退款失败*/
	REFUNDS_FAIL("9", "退款失败");
	
	private String index;
	
	private String name;
	
	private OrderStatus(String index, String name) {
		this.index = index;
		this.name = name;
	}
	
	/**
	 * 
	  * @Description: 
	  * @param index
	  * @return OrderStatus
	  * @Created:lining 2013年11月21日下午1:59:15
	  * @Modified:
	 */
	public static OrderStatus getStatusByIndex(String index) {
		for(OrderStatus status : OrderStatus.values()) {
			if(status.getIndex().equals(index)) {
				return status;
			}
		}
		return null;
	}

	public String getIndex() {
		return index;
	}

	public void setIndex(String index) {
		this.index = index;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
